<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>系统管理</title>
    <link th:href="@{/css/adminhome.css}" rel="stylesheet">
  <style>
    table, th, td {
      border: 1px purple solid;
      border-collapse: collapse;
    }
    table {
      width: 80%;
      margin: 0px auto;
    }
    th, td {
      padding: 10px;
    }
    th {
      background-color: lightseagreen;
      color: white;
    }
    .info {
      background-color: lightskyblue;
    }
    #d1,h2 {
      text-align: center;
    }
  </style>
</head>
<body th:style="'background-image: url(/img/bg.jpg)' ">
<!--头部-->
  <div id="head1">
    <h1><b>管理系统</b></h1>
    <a id="exit" th:href="@{http://localhost:9090/logout.do}" onclick="return window.confirm('您确定要退出登陆吗?')">退出登陆</a>
  </div>
  <div id="head2">
    <ul class="">
      <li class="management"><a th:href="@{/viewHospital}"><h2>医院管理</h2></a></li>
      <li class="management"><a th:href="@{/patientlist}"><h2>用户管理</h2></a></li>
      <li class="management"><a th:href="@{/doctorManage/ListDepartment}"><h2>医生管理</h2></a></li>
      <li class="management"><a th:href="@{/rolelist}"><h2>角色管理</h2></a></li>
      <li class="management"><a th:href="@{/systemnoticelist(noticeType = 1)}"><h2>系统公告</h2></a></li>
      <li class="management"><a th:href="@{/notice/enterNotice/{pageNum}(pageNum = 1)}"><h2>医院公告</h2></a></li>
    </ul>
  </div>
  <!--身体-->
  <div id="body">
    <h1>系统公告管理</h1>
    <br><br>
    <div id="d1">
      <form th:action="@{/notice/vague/enterNotice}">
        <div>根据公告标题查询公告:
          <input type="text" name="noticeName">
          <input type="submit" value="搜索">
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a th:href="@{/notice/jr}">添加公告</a>
        </div>
      </form>
    </div>
    <br><br>
    <table>
      <tr>
        <td>公告id</td>
        <td>公告标题</td>
        <td>公告内容</td>
        <td>展示状态</td>
        <td>发布时间</td>
        <td>公告类型</td>
        <td>公告操作</td>
      </tr>
      <tr th:each="notice:${noticeList.list}">
        <td th:text="${notice.noticeId}"></td>
        <td th:text="${notice.noticeName}"></td>
        <td th:text="${notice.noticeDesc}"></td>
        <td th:text="${notice.noticeState}"></td>
        <td th:text="${#dates.format(notice.outTime,'yyyy-MM-dd')}"></td>
        <td th:if="${notice.noticeType==1}">系统更新公告</td>
        <td th:if="${notice.noticeType==2}">医院公告</td>
        <td th:if="${notice.noticeType!=1 && notice.noticeType!=2}">未知</td>
        <td>

          <a th:href="@{'/notice/delete/'+${notice.noticeId}}">删除</a>
        </td>
      </tr>
    </table>

    <div style="text-align: center;">
      <a th:if="${noticeList.hasPreviousPage}" th:href="@{/notice/enterNotice/1}">首页</a>
      <a th:if="${noticeList.hasPreviousPage}" th:href="@{'/notice/enterNotice/'+${noticeList.prePage}}">上一页</a>
      <span th:each="num : ${noticeList.navigatepageNums}">
        <a th:if="${noticeList.pageNum == num}" style="color: red;" th:href="@{'/notice/enterNotice/'+${num}}" th:text="'['+${num}+']'"></a>
        <a th:if="${noticeList.pageNum != num}" th:href="@{'/notice/enterNotice/'+${num}}" th:text="${num}"></a>
    </span>
      <a th:if="${noticeList.hasNextPage}" th:href="@{'/notice/enterNotice/'+${noticeList.nextPage}}">下一页</a>
      <a th:if="${noticeList.hasNextPage}" th:href="@{'/notice/enterNotice/'+${noticeList.pages}}">末页</a>
    </div>
  </div>
  <!--尾部-->
  <div id="footer">
    <ul class="footer">
      <li><a href="http://www.nhc.gov.cn/">国家卫生健康委员会</a><span class="vertical-bar">|</span></li>
      <li><a href="http://www.cma.org.cn/">中华医学会</a><span class="vertical-bar">|</span></li>
      <li><a href="http://wsjkw.henan.gov.cn/">河南省卫生健康委员会</a></li>
    </ul>
  </div>
</body>
</html>